import request from '../request/request';

export const RegisterApi=(params)=>request.post('api/register',params)

export const LoginApi=(params)=>request.post('/api/login',params)
export const ArticleApi=(params)=>request.get('/api/articles/list',params)

// 添加文章
export const ArticleAddApi = (params) => request.post('/api/articles/addArticle', params)

// 查看文章
export const ArticleSearchApi = (params) => request.get(`/api//articles/editId/${params.id}`)

// 重新编辑文章
export const ArticleUpdateApi = (params) => request.post('/api/articles/updateArticle', params)

//编辑文章获取内容
export const ArticleEdit=(params)=>request.post("/api/articles/editId",params)

// 删除文章
export const ArticleDelApi = (params) => request.get('/api/articles/deleteArticle', params)

// 获取用户资料
export const GetUserDataApi = () => request.get('/info')

// 修改用户资料
export const ChangeUserDataApi = (params) => request.post('/api/articles/changeInfo', params)

//上传文件
export const UploadFileApi=(params)=>request.post('/api/articles/uploadFile',params)

//下载文件
export const DownloadFileApi=(params)=>request.get('/api/articles/downloadFile',params)

//查看文章详情
export const ViewArticles=(params)=>request.get('/api/articles/viewArticle',{params})

//获取评论
export const CommentApi=(params)=>request.get("/api/articles/comment",{params})

//添加评论
export const AddCommentApi=(params)=>request.post("/api/articles/addComment",params)
